<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>组件的注册方式</title>
</head>

<body>
    <div class="app">
        <hello-world></hello-world>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        Vue.component('hello-world',{
            data: function() {
                return {
                    name: 'Bob',
                    age: 8
                }
            },
            template: `
            <div>
            <button @click="add">点击</button>
            <p>{{ age }}</p>
            <p>{{ name }}</p>
            </div>
            `,
            methods: {
                add() {
                    this.age++
                }
            }
        })
        var xm = new Vue({
            el: '.app',
            data: {
            },
            methods: {
            }
              
        })

    </script>
</body>

</html>